<!DOCTYPE html>
<html>
	<head>
		<title>稻道工厂</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
		<script type="text/javascript" src="__PUBLIC__js/jquery.js"></script>
		<script type="text/javascript" src="__PUBLIC__js/script.js"></script>
		<style type="text/css">
		*{margin: 0;padding:0 ;}
		html,body{height: 100%;}
		.layout{width: 100%;height: 100%;overflow: hidden;background-image: url(__PUBLIC__img/loading.jpg); background-size:contain;-webkit-background-size:cover;}
		.layout div{ vertical-align: middle;}
		.loading{width: 100%;}
		.spinner {width:100%;color:#f5a100;font:normal 14px/60px "微软雅黑"; height: 60px;text-align: center;position: absolute;top:47%;z-index: 2;}
		.spinner > div {background-color: #f5a100;height: 6px;width: 6px;border-radius:3px ;display: inline-block;-webkit-animation: stretchdelay 1.2s infinite ease-in-out;animation: stretchdelay 1.2s infinite ease-in-out;}
		.spinner .rect2{animation-delay: -1.1s;-webkit-animation-delay: -1.1s;}
		.spinner .rect3{animation-delay: -1.0s;-webkit-animation-delay: -1.0s;}
		@-webkit-keyframes stretchdelay {
			0%, 40%, 100% { -webkit-transform: scale(1.0) }
			20%{ -webkit-transform: scale(1.5) }
			}
		@keyframes stretchdelay {
			  0%, 40%, 100% {
			    transform: scaleY(1.0);
			    -webkit-transform: scaleY(1.0);
			  }
			  20% {
			    transform: scaleY(2.0);
			    -webkit-transform: scaleY(2.0);
			  }
			}
		@media only screen and (max-height: 640px){
			.layout{background-size: cover;}
			.spinner{top: 54%;}
		}
		@media only screen and (max-height: 480px){
			.layout{background-size: cover;}
			.spinner{top: 63%;}
		}
		</style>
	</head>
	<body>
		<div class="layout">
			<div class="spinner">
			  <span>定位中</span>
			  <div class="rect1"></div>
			  <div class="rect2"></div>
			  <div class="rect3"></div>
			</div>
		</div>
	</body>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript">
setTimeout("init()",2000);
function getLocation()
{	
	if(navigator.geolocation){
	navigator.geolocation.getCurrentPosition(showMap,handleError, {enableHighAccuracy:true,timeout:5000, maximumAge:1000});
	}else{
		msgbox("您的浏览器不支持使用HTML 5来获取地理位置服务","确定");
		$(".tbtn a").click(function(e) {
			$(".tk").remove();
			window.location="/Home/community/community.html";
		});
	}
}
function showMap(value)
{
	var longitude = value.coords.longitude;
	var latitude = value.coords.latitude;
	var point = new BMap.Point(longitude, latitude); 
	var lat = point.lat;
	var lng = point.lng;
	window.location='http://www.congliangji.org/ddgc/Home/Index/location/?lat='+lat+'&lng='+lng;
}

	function handleError(value)
	{
		switch(value.code){
		case 1:
			alert("没有权限获取当前位置信息，请打开定位服务！","确定");
			$(".tbtn a").click(function(e) {
				$(".tk").remove();
				window.location="/Home/community/community.html";
			});
			break;
		case 2:
			alert("暂时获取不到位置信息","确定");
			$(".tbtn a").click(function(e) {
				$(".tk").remove();
				window.location="/Home/community/community.html";
			});
			break;
		case 3:
			alert("获取信息超时","确定");
			$(".tbtn a").click(function(e) {
				$(".tk").remove();
				window.location="/Home/community/community.html";
			});
			break;
		case 4:
			alert("未知错误","确定");
			$(".tbtn a").click(function(e)
			{
				$(".tk").remove();
				window.location="/Home/community/community.html";
			});
			break;
	}
}

function init()
{
	getLocation();
}
</script>
</html>
